package com.ruoyi.web.controller.vidiomonitor;
/**
 * ClassName: VideoAppNetMngController <br/>
 * Description: <br/>
 * date: 2021/1/4 11:16<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.hikvisionutils.model.HIKResponseResult;
import com.ruoyi.common.utils.hikvisionutils.model.HikVisionAbilityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @program: ruoyi
 * @description: 视频应用服务-视频网管
 * @author: hesion
 * @create: 2021-01-04 11:16
 **/
@Api("视频应用服务-视频网管")
@RestController
@RequestMapping("/videoapi/netmng")
public class VideoAppNetMngController {

    @ApiOperation("根据监控点列表查询录像完整性结果")
    @RequestMapping(value = "/record/list",method = RequestMethod.POST)
    public AjaxResult getRecordList(@RequestBody Map<String, Object> params) {
        String body = HikVisionAbilityUtils.getRecordList(params).getBody();
        HIKResponseResult hikResponseResult = JSONObject.parseObject(body, HIKResponseResult.class);
        return AjaxResult.success(hikResponseResult.getData());
    }
    @ApiOperation("根据监控点列表查询视频质量诊断结果")
    @RequestMapping(value = "/vqd/list",method = RequestMethod.POST)
    public AjaxResult getVqdList(@RequestBody Map<String, Object> params) {
        String body = HikVisionAbilityUtils.getVqdList(params).getBody();
        HIKResponseResult hikResponseResult = JSONObject.parseObject(body, HIKResponseResult.class);
        return AjaxResult.success(hikResponseResult.getData());
    }
    @ApiOperation("获取监控点在线状态")
    @RequestMapping(value = "/online/camera/get",method = RequestMethod.POST)
    public AjaxResult getOnlineCameraGet(@RequestBody Map<String, Object> params) {
        String body = HikVisionAbilityUtils.getOnlineCameraGet(params).getBody();
        HIKResponseResult hikResponseResult = JSONObject.parseObject(body, HIKResponseResult.class);
        return AjaxResult.success(hikResponseResult.getData());
    }
    @ApiOperation("获取编码设备在线状态")
    @RequestMapping(value = "/online/encode_device/get",method = RequestMethod.POST)
    public AjaxResult getOnlineEncodeDeviceGet(@RequestBody Map<String, Object> params) {
        String body = HikVisionAbilityUtils.getOnlineEncodeDeviceGet(params).getBody();
        HIKResponseResult hikResponseResult = JSONObject.parseObject(body, HIKResponseResult.class);
        return AjaxResult.success(hikResponseResult.getData());
    }
}
